﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;
using System.Security.Cryptography;
using System.Security.Permissions;

[assembly: RegistryPermissionAttribute(SecurityAction.RequestMinimum,
	ViewAndModify = "HKEY_CURRENT_USER")]



namespace ProcessInterceptor
{
	public partial class PassForm : Form
	{
		public PassForm()
		{
			InitializeComponent();
		}

		private void checkBox1_CheckedChanged(object sender, EventArgs e)
		{
			textBox1.UseSystemPasswordChar = !checkBox1.Checked;
		}

		private void textBox1_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Enter)
			{
				RegistryKey key;
				key = Registry.CurrentUser.OpenSubKey("Software\\Intercept", true);
				if (key == null)
					key = Registry.CurrentUser.CreateSubKey("Software\\Intercept");
				
				key.SetValue("password", textBox1.Text);
				Close();
			}
		}

		private void PassForm_Load(object sender, EventArgs e)
		{

		}
	}
}
